package com.jnu.chengzhi.controller;

import com.jnu.chengzhi.dao.UserDao;
import com.jnu.chengzhi.entity.MyUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * Program: ChengZhi
 * DATE: 2022/3/11
 * Author: 周洁锋
 * Description:
 */

@Controller
public class UserController {

    @Autowired
    private UserDao userDao;

    @RequestMapping("/test")
    public String toTest(){
        return "test";
    }


    //打开登录注册页面
    @RequestMapping("/login")
    public String login(){
        return "/login";
    }




    //注册操作
    @RequestMapping("/reg")
    public String register(MyUser myUser){
        userDao.saveUser(myUser);
        return "index";
    }

}


